LCM by long division